AUX_SOURCE_DIRECTORY(. COMMON_SRC)
ADD_LIBRARY(common ${COMMON_SRC})
ADD_DEPENDENCIES(common mir2x_3rds)

IF(NOT WIN32)
    TARGET_LINK_LIBRARIES(common stdc++fs)
ENDIF()

TARGET_LINK_LIBRARIES(common Threads::Threads )
TARGET_LINK_LIBRARIES(common ${ZSTD_LIBRARIES})
TARGET_LINK_LIBRARIES(common ${ZLIB_LIBRARIES})

IF(WIN32)
    TARGET_LINK_LIBRARIES(common JPEG::JPEG)
    TARGET_LINK_LIBRARIES(common PNG::PNG)
ENDIF()

TARGET_INCLUDE_DIRECTORIES(common PUBLIC ${LUA_INCLUDE_DIRS})
TARGET_INCLUDE_DIRECTORIES(common PUBLIC ${PNG_INCLUDE_DIRS})
TARGET_INCLUDE_DIRECTORIES(common PUBLIC ${EXTERNAL_INCLUDE_DIR})
TARGET_INCLUDE_DIRECTORIES(common PUBLIC ${MIR2X_COMMON_SOURCE_DIR})
